package com.keya.pull;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * <p>
 * 拉取院方数据记录
 * </p>
 *
 * @author hsq
 * @since 2022-08-12
 */
@ApiModel(value = "拉取院方数据记录")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("pull_study_record")
public class PullStudyRecord extends Model<PullStudyRecord> {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @TableField("patient_name")
    private String patientName;
    @TableField("accession_number")
    private String accessionNumber;
    @TableField("study_instance_uid")
    private String studyInstanceUid;
//    @TableField("series_instance_uid")
//    private String seriesInstanceUID;
    @TableField("study_description")
    private String studyDescription;
    @TableField("study_number")
    private String studyNumber;
    @TableField("exam_time")
    private String examTime;

    @ApiModelProperty(value = "检查时间")
    @TableField("study_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime studyTime;

    @ApiModelProperty(value = "设备id")
    @TableField("device_id")
    private Integer deviceId;

    @ApiModelProperty(value = "状态 0-pending;1-failed;2-success")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "失败的次数")
    @TableField("fail_count")
    private Integer failCount;

    @ApiModelProperty(value = "move成功次数")
    @TableField("success_count")
    private Integer successCount;

    @ApiModelProperty(value = "最后move时间")
    @TableField("last_move_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastMoveTime;

    @ApiModelProperty(value = "下一次move时间")
    @TableField("next_move_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime nextMoveTime;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

}
